import type { App } from 'vue'
import createInstall, { type HsaUIOptions } from './install'

// 导出所有
export * from './components'
export type * from './types/index.d.ts'

// 创建插件
const HsaUI = {
    install: (app: App, options?: HsaUIOptions) => {
        const installer = createInstall(options)
        if (installer && installer.install) {
            installer?.install(app)
        }
    }
}

export default HsaUI

// 类型声明
declare module 'vue' {
    export interface ComponentCustomProperties {
        $HSAUI: {
            version: string
        } & HsaUIOptions
    }
}